<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>原型</title>
</head>
<body>
    <script>

        function Person1(){
            this.sex = '男'
        }
        Person1.prototype.say = function(name){
            // console.log("我是可爱的 - ",name);
            return `我是可爱的 - ${name}`
        }
        let tom = new Person1()
        console.log('tom=',tom);
        console.log('Person1.prototype=',Person1.prototype);
        console.log('tom.__proto__=',tom.__proto__);
        console.log('__proto__==prototype?',Person1.prototype == tom.__proto__);
        console.log('Person1.prototype.constructor == Person1?',Person1.prototype.constructor == Person1);
        console.log('tom.__proto__.say()=',tom.__proto__.say('汤姆')); // 可以获得原型上的方法
    </script>
</body>
</html>